package com.bbs.factory.achieve;

import com.bbs.dto.UserDTO;
import com.bbs.event.LoginSuccessEvent;
import com.bbs.factory.EventFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.stereotype.Component;

//工厂实现类之创建登录成功事件工厂
@Component
public class LoginSuccessEventFactory implements EventFactory<UserDTO> {
    @Override
    public ApplicationEvent createEvent(Object source, UserDTO userDTO) {
        return new LoginSuccessEvent(source,userDTO);
    }
}
